import Rect from "./owner/rect";
import ChartOption from "./owner/chart";
import TextStyle from "./owner/chart/text";
import { guid } from "@charm:data/utils";
import { addData } from "@store/data";
import { ConfigTest } from "@charm:data/model/demo";

export const addList = (lists, item) => {
    const { rect } = ConfigTest;
    const uuid = guid();
    const _rect = new Rect({...rect});
    let data = item || {};
    data.uuid = uuid;
    data.rect = _rect;
    data.chart = new ChartOption();
    addData(uuid, data);
    return [...lists, data];
}

export const createTextStyle = () => {
    return new TextStyle();
}